#pragma once
#include <memory>
#include <vector>
#include "Polynomial.h"

class TaylorSeries
{
public:
	TaylorSeries(void);
	~TaylorSeries(void);

	double coefficient(unsigned int n) { return q(n); }
	
	// An estimate of the radius of convergence
	virtual double radius();
	shared_ptr<Polynomial> truncate(unsigned int n);

protected:
	// coefficients are defined by overriding this function
	virtual double q(unsigned int n) = 0;
	std::vector<double> _coefficients; 
};

